package com.example.binpacking.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.binpacking.mapper.QuestionnaireItemMapper;
import com.example.binpacking.model.QuestionnaireItem;
import com.example.binpacking.model.QuestionnaireName;
import com.example.binpacking.service.QuestionnaireItemService;
import com.example.binpacking.service.QuestionnaireNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.Map;
import java.util.function.Function;

@Service
public class QuestionnaireItemServiceImpl extends ServiceImpl<QuestionnaireItemMapper, QuestionnaireItem> implements QuestionnaireItemService {

@Autowired
private QuestionnaireItemMapper questionnaireItemMapper;
    @Override
    public Page<QuestionnaireItem> selectByDeletedAndParent(BigDecimal parentid, BigDecimal isdeleted, int current, int size) {
        return questionnaireItemMapper.selectByDeletedAndParent(new Page<>(current, size),isdeleted,parentid);
    }

    @Override
    public int updateNameById(BigDecimal id, String name) {
        return questionnaireItemMapper.updateNameById(id,name);
    }

    @Override
    public int updateDeletedById(BigDecimal id, BigDecimal isdeleted) {
        return questionnaireItemMapper.updateDeletedById(id,isdeleted);
    }
}
